﻿using System.Data.Entity.ModelConfiguration;

namespace JuCheap.Service.Model
{
    public class User : IBase<int>
    {
        public string Account { get; set; }

        public string Password { get; set; }

        public string TrueName { get; set; }

        public string Email { get; set; }

        public string Mobile { get; set; }

        public string Address { get; set; }
    }

    public class UserConfig : EntityTypeConfiguration<User>
    {
        public UserConfig()
        {
            HasKey(o => o.Id);
            Property(o => o.Account).HasMaxLength(20).IsRequired();
            Property(o => o.Password).HasMaxLength(36).IsRequired();
            Property(o => o.Address).HasMaxLength(100);
            Property(o => o.Email).HasMaxLength(100);
            Property(o => o.Mobile).HasMaxLength(100);
            Property(o => o.TrueName).HasMaxLength(100);
        }
    }
}
